package com.capt_4;

public class Check {
    private int count,right,wrong;
    public Check(){

    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getRight() {
        return right;
    }

    public void setRight(int right) {
        this.right = right;
    }

    public int getWrong() {
        return wrong;
    }

    public void setWrong(int wrong) {
        this.wrong = wrong;
    }

    // 批改习题
    public void checkExercise(Answer answer,Exercise exercise){
//        for (int i=0;i<exercise.getList().size();i++){
        for (int i=0;i<answer.getList().size();i++){
            if (answer.get(i) == exercise.getList().get(i).getResult()){
                right++;
            } else {
                wrong++;
            }
        }
        count = exercise.getList().size();
    }

    // 打印批改结果
    public void printCheck(){
        System.out.println("题目数量："+count);
        System.out.println("正确："+right);
        System.out.println("错误："+wrong);
    }
}
